package com.webull.information.center.common.constants;

import org.apache.commons.collections.map.CaseInsensitiveMap;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;


public class Constants {

    public static final String lang_zh = "zh";
    public static final String lang_zh_hant = "zh-hant";
    public static final String lang_en = "en";
    public static final String lang_fr = "fr";
    public static final String lang_de = "de";
    public static final String lang_ja = "ja";
    public static final String lang_it = "it";// 意大利语
    public static final Integer REGION_CH = 1;

    public static final List<String[]> googleLangArray = new Supplier<List<String[]>>() {

        @Override
        public List<String[]> get() {
            List<String[]> res = new ArrayList<>();
            // res.add(new String[] { "zh-cn", "zh" });
            // res.add(new String[] { "zh-hk", "zh-hant" });
            res.add(new String[]{"en", lang_en});
            return res;
        }

    }.get();

    /**
     * 路透的lang域webull的lang映射关系，不承诺反向是成立的。
     */
    public static final Map<String, String> ReuterLangMaping = new Supplier<Map<String, String>>() {
        /**
         * key忽略大小写
         * @return
         */
        @Override
        public Map<String, String> get() {
            Map<String, String> res = Collections.synchronizedMap(new CaseInsensitiveMap());
            res.put(lang_en, lang_en);
            res.put(lang_ja, lang_ja);
            res.put("zh-Hans", lang_zh);
            res.put("zh-Hant", lang_zh_hant);
            return res;
        }

    }.get();


}
